package com.hqyj.suppliers.controller;


import com.hqyj.suppliers.dto.SuppliersInfo;
import com.hqyj.suppliers.service.SuppliersService;
import com.hqyj.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sdx2009
 * @since 2022-09-30
 */
@RestController
@RequestMapping("/api/suppliers")
public class SuppliersController {

    @Autowired
    private SuppliersService suppliersService;

    @PostMapping("suppliersIndex")
    public ResultUtils suppliersIndex(SuppliersInfo suppliersInfo){
        return suppliersService.suppliersIndex(suppliersInfo);
    }

    @PostMapping("suppliersUpdate")
    public ResultUtils suppliersUpdate(SuppliersInfo suppliersInfo){
        return suppliersService.suppliersUpdate(suppliersInfo);
    }

    @PostMapping("deleteSuppliers")
    public ResultUtils deleteSuppliers(SuppliersInfo suppliersInfo){
        return suppliersService.deleteSuppliers(suppliersInfo);
    }

    @PostMapping("addSuppliers")
    public ResultUtils addSuppliers(SuppliersInfo suppliersInfo){
        return suppliersService.addSuppliers(suppliersInfo);
    }

    @PostMapping("selectSuppliers")
    public ResultUtils selectSuppliers(){
        return suppliersService.selectSuppliers();
    }
}
